<%= render :partial => 'messages' %>

<% unless @task.nil? %>
<%= error_messages_for 'task' %>
<% end %>